package com.qst.crop.demo.service;

import com.qst.crop.demo.entity.Product;
import com.qst.crop.demo.entity.Question;
import com.qst.crop.demo.mapper.QuesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;

@Service
public class QuesService {

    @Autowired
    QuesMapper quesMapper;

    public Integer add(String questioner, String title, String description, String imagePath, Date createdDate){
        return quesMapper.add(questioner, title, description, imagePath, createdDate);
    }

    public Integer deleteById(long questionId){
        return quesMapper.deleteById(questionId);
    }

    public Question getQuesById(long questionId){
        return quesMapper.getQuesById(questionId);
    }

    public List<Question> select(String searchWord){
        return quesMapper.select(searchWord);
    }
}

